<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.Calendar"%>    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>水电气报表上传</title>
<LINK href="images/css.css" type="text/css" rel="stylesheet">
<script type="text/javascript">
	function checkForm() {
		var subId = document.forms[0].subId.value;
		var chargeYear = document.forms[0].chargeYear.value;
		var chargeMonth = document.forms[0].chargeMonth.value;
		var file = document.forms[0].file.value;
	
		if (subId==0) {
			alert("请选择小区！");
			return false;
		}
		if (chargeYear == 0) {
			alert("请选择年份！");
			return false;
		}
		if (chargeMonth == 0) {
			alert("请选择月份！");
			return false;
		}
		if (file == null||file=="") {
			alert("请选择要上传的报表文件！");
			return false;
		}
		return true;
	}
</script>
</head>
<body>
<html:form action="utilities.do?method=uploadSave" enctype="multipart/form-data" method="post" onsubmit="return checkForm();">
<table class="tableline" cellspacing="1" cellpadding="0" width="100%"
	border="0">
	<tr>
		<td class="STYLE4" align="center" bgcolor="#ffffff" colspan="2"
			height="40">水电报表上传</td>
	</tr>
	<tr>
		<td width="217" height="26" align="right" bgcolor="#ffffff">
		物业服务处:</td>
		<td width="773" bgcolor="#ffffff">&nbsp;${dis.name }</td>
	</tr>
	<tr>
		<td width="217" height="26" align="right" bgcolor="#ffffff">小区:</td>
		<td width="773" bgcolor="#ffffff">
		&nbsp;<html:select property="subId" style="width:100px">
				<html:option value="0">请选择</html:option>
				<c:if test="${!empty subList}">
					<c:forEach items="${subList}" var="sub">
						<html:option value="${sub.id}">${sub.name}</html:option>
					</c:forEach>
				</c:if>
			</html:select>
		</td>
	</tr>
    <tr>
      <td width="217" height="26" align="right" bgcolor="#ffffff">收费日期:</td>
      <td width="773" bgcolor="#ffffff">
      &nbsp;<html:select property="chargeYear" style="width:70px">
				<html:option value="0">请选择</html:option>
				<%	Calendar c = Calendar.getInstance();
					for(int i=2012;i<=c.get(Calendar.YEAR);i++) {%>
				<html:option value="<%=String.valueOf(i+1) %>"><%=i+1 %></html:option>
				<%} %>
			</html:select>年
      &nbsp;<html:select property="chargeMonth" style="width:70px">
				<html:option value="0">请选择</html:option>
				<%	for(int i=1;i<=12;i++) {%>
				<html:option value="<%=String.valueOf(i) %>"><%=i %></html:option>
				<%} %>
			</html:select>月		
	  </td>
    </tr> 
	<tr>
		<td width="217" height="26" align="right" bgcolor="#ffffff">上传水电报表:</td>
		<td width="773" bgcolor="#ffffff">
		&nbsp;<html:file property="file"/>&nbsp;<html:submit value="上传报表" /><font color="red">${fileEmptyError }${fileFormatError }${houseNotFoundError }</font>
		</td>
	</tr>    	
</table>
</html:form>
</body>
</html>